<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			var reg=/dog/gi;//
			var str="Dog is our friend,and dog is our partner";
			alert(reg.test(str));
			str=str.replace(reg,"cat");
			//alert(str);
			str="dog is dag,and dag dfg";
			var reg2=/d.g/gi;
			str=str.replace(reg2,"cat");
			alert(str);
		</script>
	</head>
	<body>
	</body>
</html>
